Prove that each of the following equivalences using an equivalence chain.
Hint: You may use the definition of biconditional that
.
Prove the following assertions using a sequence of logical equivalences.
In addition to Cozy's documentation, a reference sheet of logical equivalences is on the website.
Hints: For equivalences where one side is much longer than the other, a good heuristic is to start with the longer side and try to apply the rules that will shorten it. In some cases, it may work better to work to shorten both sides to the same expression and then combine those two sequences into one.
Cozy's documentation for equivalence proof problems is available here.
In short: select the rule to apply and a direction — either replacing the left-side with the right-side (“left-to-right”) or vice versa (“right-to-left”) – and then click “Apply”.1 Cozy will apply the rule and produce resulting formula on the line. You can work forward from the top formula or backward from the bottom formula or both! The chain is complete when the two sides reach the same formula.
Let the domain of discourse be all students and classes at UW. Define the predicates to mean that majors in CS (presumably is a student) and to mean that majors in CE (presumably is a student). Define the predicates to mean that is a CSE class (presumably is a class) and to mean that is a MATH class (presumably is a class). Define the predicate to mean that wants to take (presumably is a student and is a class), the predicate to mean that likes (presumably is a student and is a class), and the predicate to mean that has to take (presumably is a student and is a class).
Translate each of the following logical statements into English. You should not simplify. However, you should use the techniques shown in lecture for producing more natural translations when restricting domains and for avoiding the introduction of variable names when not necessary.
Express each of these system specifications using predicates, quantifiers, and logical connectives. For some of these problems, more than one translation will be reasonable depending on your choice of predicates.
Every user has access to an electronic mailbox.
The system mailbox can be accessed by everyone in the group if the file system is locked.
The firewall is in a diagnostic state only if the proxy server is in a diagnostic state.
At least one router is functioning normally if the throughput is between 100kbps and 500 kbps and the proxy server is not in diagnostic mode.
The Java project you are working on contains the following function. It takes four boolean arguments, , , , and , and calculates some boolean function of them called :
public static boolean E(boolean a, boolean b, boolean c, boolean d) {
if (!(a || b))
return false;
if (!(!a || !b))
return false;
if (!(a || c))
return false;
return (b || !d);
}
The code checks the value of the four disjunctions , , , and and returns true iff all four of them are true. In other words, it calculates the conjunction (and) of those four expressions. Specifically, it calculates the same value as the following (non-canonical) CNF expression:
Note that this Java code could be written equivalently as a single
return statement:
return (a || b) && (!a || !b) && (a || c) && (b || !d);
The Java compiler would automatically translate that into the series
of if statements above that returns false as
soon as one disjunction is found to evaluate as false, a process known
as “short circuiting”.
Write a truth table for . Include columns for , , , , all four disjunctions, and .
Write the canonical DNF expression for .
Translate your DNF expression into a new Java implementation of
E.
Like above, your code should be a series of if
statements and then a return, except that, now, each
if should check the value of a conjunction and return
true if it is true.
(Do not simplify. Translate your expression to code in the most direct way possible.)